<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,viewport-fit=cover" />
    <title>同事验证</title>
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/weui.min.css')}}">
    <link rel="stylesheet" href="{{asset('/addons/jquery-weui-build/css/jquery-weui.css')}}">
    <link rel="stylesheet" href="{{asset('/css/system/iconfont.css')}}">
    @if($skinid == 3)
        <link rel="stylesheet" href="/css/system/common.css">
    @elseif($skinid == 1)
        <link rel="stylesheet" href="/css/theme-blue/system/common.css">
    @elseif($skinid == 2)
        <link rel="stylesheet" href="/css/theme-pink/system/iconfont-pink.css">
        <link rel="stylesheet" href="/css/theme-pink/system/common.css">
    @endif
    <link rel="stylesheet" href="/css/system/colleague-verifice.css">
    @include('sysadmin.head')
</head>
<body ontouchstart>
<div class="mian-container">
    <div class="colleague-verifice">
       {{-- <div class="weui-search-bar" id="searchBar">
            <form class="weui-search-bar__form">
                <div class="weui-search-bar__box">
                    <i class="weui-icon-search"></i>
                    <input type="search" class="weui-search-bar__input" id="searchInput" placeholder="搜索" required="">
                    <a href="javascript:" class="weui-icon-clear" id="searchClear"></a>
                </div>
                <label class="weui-search-bar__label" id="searchText">
                    <i class="weui-icon-search"></i>
                    <span>搜索</span>
                </label>
            </form>
            <a href="javascript:" class="weui-search-bar__cancel-btn" id="searchCancel">取消</a>
        </div>--}}
        <div class="weui-cells">
            @foreach($list as $l)
                <div class="weui-cell">
                    <div class="weui-cell__hd"><img src="/img/one1.jpg"></div>
                    <div class="weui-cell__bd">
                        <p class="mar-bottom">{{str_limit(getRegisterName($l->register_id),12)}}</p>
                        <p class="gray-color">{{$l->quote}}</p>
                    </div>
                    <div class="weui-cell__ft">
                        <p class="gray-color mar-bottom">{{$l->created_at}}</p>
                        <a href="javascript:void(0)" data-id="{{$l->id}}" class="a-btn refuse-btn">拒绝</a><a href="javascript:void(0)" data-id="{{$l->id}}" class="a-btn pass-btn">通过</a>
                    </div>
                </div>
            @endforeach
           {{-- <div class="weui-cell">
                <div class="weui-cell__hd"><img src="/img/one.jpg"></div>
                <div class="weui-cell__bd">
                    <p class="mar-bottom">王菲娅12</p>
                    <p class="gray-color">青苜王菲娅，新员工</p>
                </div>
                <div class="weui-cell__ft">
                    <p class="gray-color mar-bottom">2018-12-28</p>
                    <a href="javascript:void(0)" class="a-btn refuse-btn">拒绝</a><a href="javascript:void(0)" class="a-btn pass-btn">通过</a>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><img src="/img/two.jpg"></div>
                <div class="weui-cell__bd">
                    <p class="mar-bottom">王菲娅</p>
                    <p class="gray-color">青苜王菲娅，新员工</p>
                </div>
                <div class="weui-cell__ft">
                    <p class="gray-color mar-bottom">2018-12-28</p>
                    <p class="green-pass">已通过</p>
                </div>
            </div>
            <div class="weui-cell">
                <div class="weui-cell__hd"><img src="/img/tx.jpeg"></div>
                <div class="weui-cell__bd">
                    <p class="mar-bottom">王菲娅</p>
                    <p class="gray-color">请求加入</p>
                </div>
                <div class="weui-cell__ft">
                    <p class="gray-color mar-bottom">2018-12-28</p>
                    <p class="red-refuse">已拒绝</p>
                </div>
            </div>--}}
        </div>
    </div>
    {!! csrf_field() !!}
    <!-- 隐藏考核按钮部分-->
    @include('sysadmin.admin-caidan')
</div>
<script src="{{asset('/kaohe/js/jquery-2.1.4.min.js')}}"></script>
<script src="{{asset('/addons/jquery-weui-build/js/fastclick.js')}}"></script>
<script>
    $(function() {
        document.documentElement.style.fontSize = document.documentElement.clientWidth / 7.5 + 'px';
        FastClick.attach(document.body);
    });
</script>
<script src="{{asset('/addons/jquery-weui-build/js/jquery-weui.min.js')}}"></script>
<script>
    $(document).ready(function () {
        $('.kaohe-item').click(function(){
            $('.show-hidden').toggle();
        });
        $('.admin-item').click(function(){
            $('.front-show-hidden').toggle();
        });
        $('.pass-btn').click(function () {
            var applyid = $(this).attr('data-id');
            var token = $('input[name=_token]').val();
            $.ajax({
                url:'/sysadmin/user/apply?_token='+token+'&is_agree=1',
                type:'post',
                dataType:'json',
                data:{'applyid':applyid},
                error: function (request) {
                    $.toast('网络错误',"text");
                },
                success: function (data) {
                    if (data.status == 'success') {
                        $.toast(data.msg);
                        setTimeout(function(){ window.location.href=data.redirectUrl; }, 1000);
                    } else {
                        $.toast(data.msg,"text");
                    }
                },
            });
        });
        $('.refuse-btn').click(function () {
            var applyid = $(this).attr('data-id');
            var token = $('input[name=_token]').val();
            $.ajax({
                url:'/sysadmin/user/apply?_token='+token+'&is_agree=2',
                type:'post',
                dataType:'json',
                data:{'applyid':applyid},
                error: function (request) {
                    $.toast('网络错误',"text");
                },
                success: function (data) {
                    if (data.status == 'success') {
                        $.toast(data.msg);
                        setTimeout(function(){ window.location.href=data.redirectUrl; }, 1000);
                    } else {
                        $.toast(data.msg,"text");
                    }
                },
            });
        });
    })
</script>
</body>
</html>